package com.cloudkinto.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.order.OrderRakutenQueryBo;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderRakutenDo;
import com.cloudkinto.service.order.vo.OrderBaseInfoUpdateReq;
import com.cloudkinto.service.order.vo.OrderSenderUpdateReq;
import com.cloudkinto.service.order.vo.rakuten.OrderRakutenDetailResponse;
import com.cloudkinto.service.order.vo.rakuten.OrderRakutenExcelReq;
import com.cloudkinto.service.order.vo.rakuten.OrderRakutenListRes;
import com.cloudkinto.service.order.vo.rakuten.OrderShippingModelRequest;
import com.cloudkinto.service.orderoutput.vo.OrderOutputAddReq;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-06-03
 */
public interface OrderRakutenService extends IService<OrderRakutenDo> {

    SingleResult addInit();

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    OrderRakutenDetailResponse detail(Long id);

    OrderRakutenDetailResponse detail(String id);

    SingleResult pageInit();

//    List<OrderRakutenListRes> getList(Map<String, String> map);

    PageResult getListPage(OrderRakutenQueryBo bo);

    /**
     * 从乐天平台同步订单
     *
     * @param dateStart 订单开始时间
     * @param dateEnd   订单结束时间
     * @param shopId    当前店铺
     * @return
     */
    int orderSync(String dateStart, String dateEnd, String dateType, long shopId);

    void updateOrderShipping(List<OrderShippingModelRequest> shippingModelRequests, Long shopId, String
            secret, String license);

    void exportExcel(OrderRakutenQueryBo bo, HttpServletResponse response) throws IOException;


    SingleResult export2ShipOrderExcel(MultipartFile file, Long userId, Long companyId);

    /**
     * @param orderids
     * @param currentUserId
     * @param b
     * @return
     */
    SingleResult queryOrder2SendOut(String[] orderids, Long currentUserId, boolean isAuto,Long companyId);
    SingleResult queryOrder2SendOutNoPackage(String orderid, Long currentUserId, boolean b, Long companyId);

    SingleResult sendOutMatch(List<OrderOutputAddReq> orderOutputAddReqList,Long userId,Long companyId);

    int setOrderSend(Long[] orderids,Long userId);

    boolean setOrderSysTips(Long orderId, String desc, Long companyId);

    void autoRefreshOrder();

    void autoConfirmOrder();

    void updateRakutenExpressNumberByOrderIds
            (Map<Integer, List<OrderShippingModelRequest>> orderShippingModelMap);

    List<Map> ordersyncInit(Long currentUserId, Long companyId);

    void tset1();

    SingleResult updateOrderSender(OrderSenderUpdateReq req);

    SingleResult updateOrderBaseInfo(OrderBaseInfoUpdateReq req);

    void updateOrderSendOut(String orderNo);

    List<String> expire(Long companyId);

    void autoSendRakutenOrder();
    void autoSendRakutenOrder2();

}
